var LodashQW = {
    Array: {
        chunk: function (array, size) {
            if(!checkInput(array,size)){
                return [];
            }
            var result = new Array();
            var size_i = parseInt(size);
            var groupNum = Math.ceil(array.length/size_i);
            console.log(groupNum);
            for(var i=0;i<groupNum;i++){
                var end = i*size_i+size_i > array.length ? array.length : i*size_i+size_i;
                console.log(array.slice(i*size_i,end));
                result.push(array.slice(i*size_i,end))
            }
            return result;
        }
    }
};
function checkInput(array, size){
    if (!array || !isArray(array) || array.length == 0 || !size || !isAllNumber(size)) {
        return false;
    }
    var size_i = parseInt(size);
    if(size_i<1){
        return false;
    }
    return true;
}
function isAllNumber(val) {
    var reg = /^[\d]+$/;
    return reg.test(val);
}

function isArray(obj) {
    return Object.prototype.toString.call(obj) === '[object Array]';
}